﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class sys_new : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        
    }

    protected void tb_username_TextChanged(object sender, EventArgs e)
    {
        if (MasApp.BLL.Search.HaveUsername(tb_username.Text))
        {
            Label1.Visible = true;
        }
    }
    protected void ImageButton1_Click(object sender, EventArgs e)
    {
        string username = tb_username.Text;
        string password = tb_password.Text;
        string realname = tb_realname.Text;
        string mphone = tb_mphone.Text;
        if (MasApp.BLL.reg.AddmanaUser(username, password, realname, mphone))
        {
            MasApp.BLL.ResponseHelper.alert("添加成功！");
            MasApp.BLL.ResponseHelper.Redirect("edit.aspx");
        }
        else
        {
            MasApp.BLL.ResponseHelper.alert("添加失败！");
            MasApp.BLL.ResponseHelper.Redirect("edit.aspx");
        }

    }
}
